package com.gingko.duominuo.network.api

import com.gingko.duominuo.data.ApiResponse
import com.gingko.duominuo.data.TaskConfigVo
import com.gingko.duominuo.data.model.*
import com.gingko.duominuo.data.request.*
import retrofit2.http.*


interface GinkgoService {

    @POST("code")
    suspend fun sendVerifyCode(@Body sendSMSReq: SendSMSReqVo): ApiResponse<String>

    @POST("user")
    suspend fun register(@Body registerReqVo: RegisterReqVo): ApiResponse<String>

    @GET("user")
    suspend fun login(@QueryMap map: Map<String, String>): ApiResponse<UserVo>

    @GET("task")
    suspend fun getTasks(@QueryMap map: Map<String, String>): ApiResponse<List<TaskVo>>

    @POST("task")
    suspend fun createTask(@Body createTaskReqVo: CreateTaskReqVo): ApiResponse<CreateTaskVo>

    @GET("order")
    suspend fun getWorkOrders(@QueryMap map: Map<String, String>): ApiResponse<WorkOrderListVo>

    @PUT("order")
    suspend fun submitWorkOrder(@Body submitWorkOrderReqVo: SubmitWorkOrderReqVo): ApiResponse<String>

    @POST("order")
    suspend fun getWorkOrderDetail(@Body orderDetailReqVo: OrderDetailReqVo): ApiResponse<WorkOrderDetailVo>

    @GET("job")
    suspend fun getJobReviewContent(@Query("job_id") jobId: String): ApiResponse<JobReviewContentVo>

    @GET
    suspend fun getTaskFilter(@Url url: String): TaskFilterVo

    @GET
    suspend fun getJsInject(@Url url: String): List<InjectAndInterceptVo>

    @GET
    suspend fun getTaskConfig(@Url url: String): TaskConfigVo
}